﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>学生列表</title>

		<link rel="stylesheet" type="text/css" href="../easyui-1.5.1/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../easyui-1.5.1/themes/icon.css">
		<script src="../jquery-2.1.1/jquery.min.js"></script>
		<script src="../easyui-1.5.1/jquery.easyui.min.js"></script>
		<script src="../easyui-1.5.1/locale/easyui-lang-zh_CN.js"></script>
		<script src="../jquery-2.1.1/gVerify.js"></script>
		<link rel="stylesheet" type="text/css" href="cs/style.css" />
	</head>

	<div data-options="region:'west',split:true" style="width:180px;" title="可选选项">
		<ul id="tt11" class="easyui-tree">
			<li>
				<a href="deleteAll">清除数据</a>
			</li>
			<li>
				<a href="importxls">导入学生数据</a>
			</li>
			<li>
				<a href="uploadMaterial">上传本节课的任务书</a>
			</li>
			<li>
				<a href="exportxls">导出学生数据</a>
			</li>
			<li>
				<a href="downloadzip">导出学生作业</a>
			</li>
			<li>
				<a href="exportemp">导出模板</a>
			</li>
			<li>总人数：&nbsp;${total}&nbsp;人</li>
			<li>已到：&nbsp;${arrival }&nbsp;人</li>
		</ul>
	</div>

	<body class="easyui-layout">
		<div data-options="region:'north'" style="height:98px;width:100%;overflow:hidden">
			<div class="page_top">
				<div class="page_logo">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="56"></td>
							<td colspan="4" rowspan="2" width="80%">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td align="right" id="time"><img src="easyui-1.5.1/themes/metro/images/slider_handle.png" /><span id="dateSpan"></span></td>
									</tr>
									<tr>
										<td height="10">
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td width="56">
								<img src="img/logo.png" width="306" height="64" align="middle" /></td>
						</tr>
					</table>

				</div>
				<div class="page_dh">
					<div class="page_user">
						<table>
							<tr>
								<td id="username">当前用户：admin</td>
							</tr>
						</table>
					</div>
					<div id="divmodule" class="page_nav">
						<ul id='modules' class="nav">
							<h1><li>学生列表</li></h1>
						</ul>
					</div>
				</div>
			</div>
		</div>

		<div data-options="region:'center'">
			<div class="easyui-tabs" data-options="fit:true">
				<div title="內容列表" style="padding:20px;">
					<h1><a href="list">刷新</a></h1>
					<table class="easyui-datagrid" style="width:100%;height:100%">
						<thead>
							<tr>
								<th data-options="field:'uid'" width="130px" align="center">学号</th>
								<th data-options="field:'username'" width="130px" align="center">用户名</th>
								<th data-options="field:'stats'" width="130px" align="center">考勤</th>
								<th data-options="field:'computername'" width="155px" align="center">电脑名</th>
								<th data-options="field:'homework'" width="155px" align="center">作业</th>
								<th data-options="field:'filesize'" width="130px" align="center">作业大小</th>
								<th data-options="field:'jl'" width="130px" align="center">奖励</th>
								<th data-options="field:'cz'" width="180px" align="center">操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${students }" var="student">
								<tr>
									<td>${student.uid }</td>
									<td>${student.username }</td>
									<td>${student.stats}</td>
									<td>${student.computername }</td>
									<td>
										<a href="#" onclick="javascript:downloadfile('${student.homework}')">${student.homework}</a>
									</td>
									<td>${student.filesize}K</td>
									<td>
										<a href="good?uid=${ student.uid}">good</a>&nbsp;
										<a href="bad?uid=${ student.uid}">bad</a>&nbsp;( ${student.good} )</td>
									<td>
										<a href="delete?uid=${ student.uid}">清除</a>&nbsp;&nbsp;
										<a href="truant?uid=${ student.uid}">旷课</a>&nbsp;&nbsp;
										<a href="late?uid=${ student.uid}">迟到</a>&nbsp;&nbsp;
										<a href="sick?uid=${ student.uid}">病假</a>&nbsp;&nbsp;
										<a href="holiday?uid=${ student.uid}">事假</a>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
		</div>

		<script>
			//Date 日期   get得到  year年  month月  day日 
			function showtime() {
				var myDate = new Date(); //获取系统当前的时间
				var hour = myDate.getHours(); //得到当前时间小时  时
				var mm = myDate.getMinutes(); //得到当前时间分钟  分
				var sec = myDate.getSeconds(); //得到当前时间秒  秒
				var myhour = '';
				if(hour > 12) {
					myhour = '下午' + (hour - 12);
				} else {
					myhour = '上午' + hour;
				}
				//拼接字符串  2016年3月28日 09时03分30秒
				var dateStr = myhour + " 时 " + mm + " 分 " + sec + " 秒";
				//显示在页面标签 id="date" 标签上
				document.getElementById("dateSpan").innerHTML = dateStr;
			}
			//每隔1秒刷新一次  显示在页面上的时间
			setInterval("showtime();", 1000);

			$(function() {
				$.ajax({
					url: "json",
					type: "GET",
					dataType: "json",
					success: function(data) {
						var temp = "";
						alert("success");
						for(var i = 0; i < data.result.length; i++) {
							var obj = data.result[i];
							var uid = obj.uid;;
							var username = obj.username;
							var stats = obj.stats;
							var computername = obj.computername;
							var homework = obj.homework;
							var filesize = obj.filesize;
							var good = obj.good;
							temp += '<tr><td>学号:' + uid + '</td><td>用户名:' + username + '</td></td>考勤:' + stats + '</td><td>电脑名:' + computername + '</td><td>作业:' + homework + '</td><td>作业大小:' + filesize + '</td><td>奖励:' + good + '</td></tr>';
						}
						//$("#test").html(temp);
						document.getElementById("test").innerHTML = temp;
					},
					error: function(e) {
						alert("error");
					}
				});
			})
		</script>

	</body>

</html>